<?php

/* From a string
 * define('my_db', 'host|un|pwd|name');
 * 
 * Get a new, or cached, connection
 * $db = tm\Mysqli::getConnection(my_db);
 *  
 */

namespace tm;

class Mysqli {
  
  private static $connections;

  // @todo: Return null on error  
  public static function getConnection($db){
    if (\array_key_exists($db, self::$connections))
      return self::$connections[$db];
    list($host,$user,$pass,$name)=\explode('|',$details);
    return self::$connections[$db] = new mysqli($host,$user,$pass,$name);
  }

  public static getHtmlTable($db,$sql){
    self::getConnection($db);
    //...
  }

  public static getNameValue($sql){
  }
  
  public static getColumn($sql){
  }


  public static getSets($data){
  }
  
  

}


